package com.ny.zmb.glxt.controller;

import com.ny.zmb.glxt.entity.PmArea;
import com.ny.zmb.glxt.service.IPmAreaService;
import com.ny.zmb.openapi.controller.entity.Result;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/glxt/pmArea")
@CrossOrigin
public class PmAreaController {

    @Resource
    private IPmAreaService pmAreaService;

    @RequestMapping("getArea")
    public Result getArea(@RequestParam(required = false) Integer level, @RequestParam(required = false) Integer pid) {
        return Result.ok(pmAreaService.selectAllByLevelWithPid(level, pid));
    }
}
